DROP TABLE IF EXISTS tableA;
DROP TABLE IF EXISTS tableB;

CREATE TABLE tableA (a INTEGER,z INTEGER);
CREATE TABLE tableB (a INTEGER,b INTEGER,z INTEGER);

SELECT a.z, b.b FROM tableB AS b JOIN tableA AS a ON a.a=b.b;
